import 'package:flutter/material.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';


class TimUIStickerSingleFull extends StatelessWidget {

  final CustomStickerPackage customStickerPackage;
  final void Function()? onShare;

  const TimUIStickerSingleFull({super.key, required this.customStickerPackage, this.onShare});

  @override
  Widget build(BuildContext context) => Column(
    mainAxisAlignment: MainAxisAlignment.start,
    children: [
      Padding(
        padding: EdgeInsets.only(top: 12,bottom: 30),
        child: SizedBox(
          height: 20,
          child: Center(
            child: Container(
              width: 40, height: 6,
              color: Colors.black26,
            ),
          ),
        ),
      ),
      Text(customStickerPackage.name,style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),textAlign: TextAlign.start,),
      SizedBox(height: 3,),
      Text("由 FunShot 创建 · ${customStickerPackage.stickerList.length} 个",style: TextStyle(fontSize: 14,fontWeight: FontWeight.normal,color: Colors.black26),textAlign: TextAlign.start,),
      SizedBox(height: 12,),
      Text("使用这款表情包; 尽情表达各种感受",style: TextStyle(fontSize: 14,fontWeight: FontWeight.normal,color: Colors.black26),textAlign: TextAlign.start,),
      Expanded(
        child: GridView(
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 4,
            childAspectRatio: 1,
          ),
          children: customStickerPackage.stickerList.map((item) {
            LayerLink layerLink = LayerLink();
            return Padding(
                padding: const EdgeInsets.all(8),
                child: CompositedTransformTarget(
                    link: layerLink,
                    child: CustomEmojiItem(
                        isBigImage: true,
                        baseUrl: customStickerPackage.baseUrl,
                        sticker: item)));
          },
          ).toList(),
        ),
      )
    ],
  );
}